Skip to content

Update piemenus.js#5900

Open
Aayush-kumar-ctrl wants to merge 1 commit intosugarlabs:masterfrom
Aayush-kumar-ctrl:patch-7
Open

Update piemenus.js#5900
Aayush-kumar-ctrl wants to merge 1 commit intosugarlabs:masterfrom
Aayush-kumar-ctrl:patch-7

Conversation

@Aayush-kumar-ctrl
Copy link

This update adds accessible audio feedback to pie menu selections.

  • Introduced a speech toggle to enable/disable audio feedback.
  • Implemented a safe wrapper around the Web Speech API to announce selected pie menu labels.
  • Prevented overlapping speech by cancelling previous utterances before speaking a new one.
  • Added an aria-live region to ensure screen readers also announce selections.
  • Kept the implementation non-invasive and decoupled from core pie menu logic.

This improves accessibility for visually impaired users while maintaining backward compatibility and user control over the feature.

@github-actions
Copy link
Contributor

✅ All Jest tests passed! This PR is ready to merge.

@7se7en72025
Copy link
Contributor

LGTM on the accessibility logic, but could you please confirm where speakLabel is actually called in the menu loop and check if the export keyword is compatible with the current module system

@Aayush-kumar-ctrl
Copy link
Author

Aayush-kumar-ctrl commented Feb 26, 2026

Thanks for the review!
Currently, speakLabel() is defined as a private helper within this module and is intended to be invoked from the pie menu selection handler, not attached to the render loop, but meant to be called inside the selection logic to ensure it only announces confirmed selections and avoids repeated triggers during hover or redraw cycles.

export keyword compatibility
If piemenus.js is currently loaded via a classic script tag or follows a non-ESM module pattern, then export would indeed not be compatible.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants